/**author:yebinx email:yebinx@21cm.com*/
export default class RedTarVo{
    private caller:any;
    private mTar:any;
    private methed:Function;
    private mParam:any;
    constructor(red:any,_caller:any=null,_methed:Function=null,_param=null){
        this.mTar=red;
        this.caller=_caller;
        this.methed=_methed;
        this.mParam=_param;
    }

    public update(){
        if(this.caller && this.methed)this.mTar.visible = this.methed.call(this.caller,[this.mParam]);
    }

    /**强制设置状态*/
    public updateSt(_show:boolean){
        this.mTar.visible = _show;
    }
	
	public get tar(){
		return this.mTar;
	}
	
	public destroy(){
		this.mTar=null;
		this.caller=null;
		this.methed=null;
	}
}